<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script type="text/javascript">
			function createFunctions() {
				var result = new Array();
				for(var i = 0; i < 10; i++) {
					result[i] = function() {
						return i;
					};
				}
				console.log(result);
				return result;
			}
			var funcs = createFunctions();
			for(var i = 0; i < funcs.length; i++) {
				console.log(funcs[i]());
			}
			var Book = function(newIsbn, newTitle, newAuthor) {
				// 私有属性 
				var isbn, title, author;
				// 私有方法 
				function checkIsbn(isbn) {
					// TODO 
				}
				// 特权方法 
				this.getIsbn = function() {
					return isbn;
				};
				this.setIsbn = function(newIsbn) {
					if(!checkIsbn(newIsbn)) throw new Error('Book: Invalid ISBN.');
					isbn = newIsbn;
				};
				this.getTitle = function() {
					return title;
				};
				this.setTitle = function(newTitle) {
					title = newTitle || 'No title specified.';
				};
				this.getAuthor = function() {
					return author;
				};
				this.setAuthor = function(newAuthor) {
					author = newAuthor || 'No author specified.';
				};
				// 构造器代码 
				this.setIsbn(newIsbn);
				this.setTitle(newTitle);
				this.setAuthor(newAuthor);
			}; 
			// 共有、非特权方法 
			Book.prototype = {
				display: function() {
					// TODO 
				}
			};
		</script>
	</body>

</html>